﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleLiteForm.Helpers
{
    /// <summary>
    /// Math helper functions.
    /// </summary>
    public static class MathHelper
    {
        /// <summary>
        /// Clamps the value to the given interval.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <param name="min">The minimum.</param>
        /// <param name="max">The maximum.</param>
        /// <returns>The clamped value.</returns>
        public static int Clamp(int value, int min, int max)
        {
            if (value < min)
                return min;
            if (value > max)
                return max;
            return value;
        }
    }
}
